<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>"/>
    
    <title>My JSP 'index.jsp' starting page</title>

	<script type="text/javascript" src="${basePath }js/jquery.js"></script>
	<script type="text/javascript" src="${basePath }dwr/engine.js"></script>
	<script type="text/javascript" src="${basePath }dwr/interface/HelloWorld.js"></script>
	
	<script type="text/javascript">
		function getUserName(){
			var username = $("#username").val();
			HelloWorld.getHello(username,function(data){
				$("#result").html(data);
			});
		}
	</script>
  </head>
  
  <body>
    <p>请输入您的名字:<input type="text" id="username"/><button onclick="getUserName();">确定</button></p>
    <div id="result"></div>
  </body>
</html>
